﻿
CREATE PROCEDURE [admin].[MakeSecurityTriggers_Child]
	@TableParent sysname
AS

DECLARE cur CURSOR FOR
SELECT Name FROM admin.sec_ChildTables(@TableParent)

DECLARE @TableName sysname

OPEN cur

FETCH NEXT FROM cur INTO @TableName

WHILE @@fetch_status = 0 BEGIN
	EXEC admin.MakeSecurityTrigger_Child @TableName,@TableParent
	FETCH NEXT FROM cur INTO @TableName
END

CLOSE cur
DEALLOCATE cur

